3.670 \(\int (a+i a \tan (e+f x)) (A+B \tan (e+f x)) \, dx\)

Optimal. Leaf size=46 \[ -\frac {a (B+i A) \log (\cos (e+f x))}{f}+a x (A-i B)+\frac {i a B \tan (e+f x)}{f} \]

[Out]

a*(A-I*B)*x-a*(I*A+B)*ln(cos(f*x+e))/f+I*a*B*tan(f*x+e)/f

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 46, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.083, Rules used = {3525, 3475} \[ -\frac {a (B+i A) \log (\cos (e+f x))}{f}+a x (A-i B)+\frac {i a B \tan (e+f x)}{f} \]

Antiderivative was successfully verified.

[In]

Int[(a + I*a*Tan[e + f*x])*(A + B*Tan[e + f*x]),x]

[Out]

a*(A - I*B)*x - (a*(I*A + B)*Log[Cos[e + f*x]])/f + (I*a*B*Tan[e + f*x])/f

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3525

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(a*c - b
*d)*x, x] + (Dist[b*c + a*d, Int[Tan[e + f*x], x], x] + Simp[(b*d*Tan[e + f*x])/f, x]) /; FreeQ[{a, b, c, d, e
, f}, x] && NeQ[b*c - a*d, 0] && NeQ[b*c + a*d, 0]

Rubi steps

\begin {align*} \int (a+i a \tan (e+f x)) (A+B \tan (e+f x)) \, dx &=a (A-i B) x+\frac {i a B \tan (e+f x)}{f}+(a (i A+B)) \int \tan (e+f x) \, dx\\ &=a (A-i B) x-\frac {a (i A+B) \log (\cos (e+f x))}{f}+\frac {i a B \tan (e+f x)}{f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 66, normalized size = 1.43 \[ -\frac {i a A \log (\cos (e+f x))}{f}+a A x-\frac {i a B \tan ^{-1}(\tan (e+f x))}{f}+\frac {i a B \tan (e+f x)}{f}-\frac {a B \log (\cos (e+f x))}{f} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + I*a*Tan[e + f*x])*(A + B*Tan[e + f*x]),x]

[Out]

a*A*x - (I*a*B*ArcTan[Tan[e + f*x]])/f - (I*a*A*Log[Cos[e + f*x]])/f - (a*B*Log[Cos[e + f*x]])/f + (I*a*B*Tan[
e + f*x])/f

________________________________________________________________________________________

fricas [A]  time = 1.71, size = 64, normalized size = 1.39 \[ -\frac {2 \, B a - {\left ({\left (-i \, A - B\right )} a e^{\left (2 i \, f x + 2 i \, e\right )} + {\left (-i \, A - B\right )} a\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )}{f e^{\left (2 i \, f x + 2 i \, e\right )} + f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))*(A+B*tan(f*x+e)),x, algorithm="fricas")

[Out]

-(2*B*a - ((-I*A - B)*a*e^(2*I*f*x + 2*I*e) + (-I*A - B)*a)*log(e^(2*I*f*x + 2*I*e) + 1))/(f*e^(2*I*f*x + 2*I*
e) + f)

________________________________________________________________________________________

giac [B]  time = 0.74, size = 110, normalized size = 2.39 \[ \frac {-i \, A a e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - B a e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - i \, A a \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - B a \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 2 \, B a}{f e^{\left (2 i \, f x + 2 i \, e\right )} + f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))*(A+B*tan(f*x+e)),x, algorithm="giac")

[Out]

(-I*A*a*e^(2*I*f*x + 2*I*e)*log(e^(2*I*f*x + 2*I*e) + 1) - B*a*e^(2*I*f*x + 2*I*e)*log(e^(2*I*f*x + 2*I*e) + 1
) - I*A*a*log(e^(2*I*f*x + 2*I*e) + 1) - B*a*log(e^(2*I*f*x + 2*I*e) + 1) - 2*B*a)/(f*e^(2*I*f*x + 2*I*e) + f)

________________________________________________________________________________________

maple [A]  time = 0.02, size = 81, normalized size = 1.76 \[ \frac {i a B \tan \left (f x +e \right )}{f}+\frac {i a \ln \left (1+\tan ^{2}\left (f x +e \right )\right ) A}{2 f}+\frac {a \ln \left (1+\tan ^{2}\left (f x +e \right )\right ) B}{2 f}-\frac {i a B \arctan \left (\tan \left (f x +e \right )\right )}{f}+\frac {a A \arctan \left (\tan \left (f x +e \right )\right )}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+I*a*tan(f*x+e))*(A+B*tan(f*x+e)),x)

[Out]

I*a*B*tan(f*x+e)/f+1/2*I/f*a*ln(1+tan(f*x+e)^2)*A+1/2/f*a*ln(1+tan(f*x+e)^2)*B-I/f*a*B*arctan(tan(f*x+e))+1/f*
a*A*arctan(tan(f*x+e))

________________________________________________________________________________________

maxima [A]  time = 0.84, size = 50, normalized size = 1.09 \[ \frac {2 \, {\left (f x + e\right )} {\left (A - i \, B\right )} a - {\left (-i \, A - B\right )} a \log \left (\tan \left (f x + e\right )^{2} + 1\right ) + 2 i \, B a \tan \left (f x + e\right )}{2 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))*(A+B*tan(f*x+e)),x, algorithm="maxima")

[Out]

1/2*(2*(f*x + e)*(A - I*B)*a - (-I*A - B)*a*log(tan(f*x + e)^2 + 1) + 2*I*B*a*tan(f*x + e))/f

________________________________________________________________________________________

mupad [B]  time = 8.47, size = 38, normalized size = 0.83 \[ \frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,\left (B\,a+A\,a\,1{}\mathrm {i}\right )}{f}+\frac {B\,a\,\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A + B*tan(e + f*x))*(a + a*tan(e + f*x)*1i),x)

[Out]

(log(tan(e + f*x) + 1i)*(A*a*1i + B*a))/f + (B*a*tan(e + f*x)*1i)/f

________________________________________________________________________________________

sympy [A]  time = 0.42, size = 53, normalized size = 1.15 \[ \frac {2 B a}{- f e^{2 i e} e^{2 i f x} - f} - \frac {i a \left (A - i B\right ) \log {\left (e^{2 i f x} + e^{- 2 i e} \right )}}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))*(A+B*tan(f*x+e)),x)

[Out]

2*B*a/(-f*exp(2*I*e)*exp(2*I*f*x) - f) - I*a*(A - I*B)*log(exp(2*I*f*x) + exp(-2*I*e))/f

________________________________________________________________________________________